<template>
	<view class="content">
<!-- 		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
			asfasdsadsd反对的是萨达萨达是辐射大撒旦
		</view> -->
		<uni-drawer ref="draw" :mask="mask" :width="drawWid" :mode='mode'>
			<view style="padding:30rpx;">
				<view class="uni-title">抽屉式导航</view> 
			</view>
			<button type="warn" @tap="hide()" style="margin-top: 100rpx;">关闭</button>
<button type="warn" @tap="hide()" style="margin-top: 100rpx;">关闭</button>
		</uni-drawer>
		<button type="primary" @tap="show()">显示</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				mask: true,
				left: 'left',
				drawWid: 80, //最好把uni-drawer组件里的参数width的type改为String，不然想用百分比报错烦
				maskClick: true,
				mode: 'left'
			}
		},
		onLoad() {

		},
		methods: {
			show() {
				this.$refs.draw.open();
			},
			hide() {
				this.$refs.draw.close();
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
